/**
 * Created by Administrator on 2017/6/21 0021.
 * Time: 10:24
 * 用途：开发配置
 */
import {conf} from "./config/dev.conf";
import {PATHS, baseConfig} from "./webpack.config.base"
import CopyWebpackPlugin from "copy-webpack-plugin"

var devConfig = baseConfig.apply(conf);
devConfig.devServer = {
    //hot: true,
    //inline: true,
    contentBase: PATHS.dist,
    port: conf.port,
    //inline: true,
    compress: true,
    stats: {
        colors: true,
        errors: true,
        warnings: true,
        modules: false,
        chunks: false
    },
    //配置跨域可访问，目的在于将字体文件编译后，浏览器拒绝访问
    headers: {
        "Access-Control-Allow-Origin": "*",
        "Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, PATCH, OPTIONS",
        "Access-Control-Allow-Headers": "X-Requested-With, content-type, Authorization"
    },
    proxy: {
        '/iconfont': {
            changeOrigin: true,
            target: 'http://localhost',
            port: conf.port,
            secure: false
        },
        "/api": {
            changeOrigin: true,
            target: 'http://192.168.1.129:9999',
            pathRewrite: {
                // 重写请求，比如我们源访问的包含/api，那么请求会将/api替换为/yh/ihr/api
                '/api': '/'
            }
        }
    },
    https: conf.https
};
export default devConfig
